package com.atguigu.gulimall.ware.service;

import com.atguigu.common.to.LockStockTo;
import com.atguigu.common.to.SkuStockTo;
import com.atguigu.common.to.mq.OrderTo;
import com.atguigu.common.utils.PageUtils;
import com.atguigu.gulimall.ware.entity.WareSkuEntity;
import com.atguigu.gulimall.ware.vo.WareSkuLockTo;
import com.baomidou.mybatisplus.extension.service.IService;

import java.util.List;
import java.util.Map;

/**
 * 商品库存
 *
 * @author lxx
 * @email 1914264274@qq.com
 * @date 2022-03-08 15:42:01
 */
public interface WareSkuService extends IService<WareSkuEntity> {

    PageUtils queryPage(Map<String, Object> params);

    PageUtils queryByCondition(Map<String, Object> params);

    void addStock(Long skuId, Long wareId, Integer skuNum);

    List<SkuStockTo> hashStock(List<Long> skuIds);

    Boolean lockStock(WareSkuLockTo wareSkuLockTo);

    void releaseStock(LockStockTo lockStockTo);

    void releaseStock(OrderTo order);
}

